package com.qf.simple_queue;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author 千峰教育
 * @Company http://www.mobiletrain.org/
 * @Version 1.0
 */
@Component
@RabbitListener(queues = "simple_queue")
public class SimpleListener {

    /**
     *
     *
     * @param msg 队列中的数据
     */
    @RabbitHandler
    public void onMessage(String msg){
        System.out.println("消息队列中的数据：" + msg);
    }
}
